<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace app\api\controller;

use app\api\model\haoyayi\UserInfo as UserInfoModel;
use think\Controller as ThinkController;

class Test extends ThinkController
{
    public function index(){
        $UserInfoModel = new UserInfoModel;
        $where = function ($query){
            $query->field(['id','openid'])->where('id','=',20);
        };
        $data = $UserInfoModel->find($where);
        dump($data->id);
    }
}